package com.todo.biz.application.convert;

import com.todo.biz.common.enums.DetectionRiskLevelEnum;
import com.todo.biz.application.helper.detection.entity.ImgRiskLevel;
import com.todo.biz.application.helper.detection.entity.TextRiskLevel;

/**
 * @author azhebuxing
 * @date 2025/2/28 02:37
 * @description
 */
public class DetectionRiskLevelConvert {

    public static DetectionRiskLevelEnum valueOfDetectionRiskLevelEnum(ImgRiskLevel imgRiskLevel) {
        if (imgRiskLevel == null) {
            return DetectionRiskLevelEnum.NONE;
        }
        if (ImgRiskLevel.HIGH.equals(imgRiskLevel)) {
            return DetectionRiskLevelEnum.HIGH;
        }
        if (ImgRiskLevel.MEDIUM.equals(imgRiskLevel)) {
            return DetectionRiskLevelEnum.MEDIUM;
        }
        if (ImgRiskLevel.LOW.equals(imgRiskLevel)) {
            return DetectionRiskLevelEnum.LOW;
        }
        return DetectionRiskLevelEnum.NONE;
    }

    public static DetectionRiskLevelEnum valueOfDetectionRiskLevelEnum(TextRiskLevel textRiskLevel) {
        if (textRiskLevel == null) {
            return DetectionRiskLevelEnum.NONE;
        }
        if (TextRiskLevel.HIGH.equals(textRiskLevel)) {
            return DetectionRiskLevelEnum.HIGH;
        }
        if (TextRiskLevel.MEDIUM.equals(textRiskLevel)) {
            return DetectionRiskLevelEnum.MEDIUM;
        }
        if (TextRiskLevel.LOW.equals(textRiskLevel)) {
            return DetectionRiskLevelEnum.LOW;
        }
        return DetectionRiskLevelEnum.NONE;
    }
}
